package org.nepu.scr.indexrate.converter.compliancerate.datacompleteness;

import cn.hutool.json.JSONUtil;
import org.nepu.scr.indexrate.vo.compliancerate.datacompleteness.PowerAndAuxiliaryMenu1_5;

import javax.persistence.AttributeConverter;
import javax.persistence.Convert;

@Convert
public class PowerAndAuxiliaryMenuConverter1_5 implements AttributeConverter<PowerAndAuxiliaryMenu1_5, String> {
    @Override
    public String convertToDatabaseColumn(PowerAndAuxiliaryMenu1_5 powerAndAuxiliaryMenu) {
        return JSONUtil.toJsonStr(powerAndAuxiliaryMenu);
    }

    @Override
    public PowerAndAuxiliaryMenu1_5 convertToEntityAttribute(String s) {
        return JSONUtil.toBean(s, PowerAndAuxiliaryMenu1_5.class);
    }
}
